import request from "@/utils/axios/request";
import { User } from "..";

 const getUsers = (params: any) => {
  return request.get(`/user/get?pageNum=${params.pageNum}&pageSize=${params.pageSize}&name=${params.name}&phone=${params.phone}&email=${params.email}${params.auth ? `&auth=${params.auth}` : ""}`)
}

const delUsers = (ids: number[]) => {
  return request.post('/user/del', ids)
}

const updateUser = (user: User) =>{
  return request.post('/user/update', user)
}

const addUser = (user: User) => {
  return request.post('/user/add', user)
}



const userApi = {
  getUsers,
  delUsers,
  updateUser,
  addUser
}

export default userApi

